<template>
  <div class="information">
    <!-- 头部 -->
    <van-nav-bar
      title="会员资料"
      left-text=""
      left-arrow
      @click-left="onClickLeft"
    />
    <!-- 内容 -->
    <main>
      <van-cell title="头像" is-link :value="infolist.avatarImg" />
      <van-cell title="帐号" is-link value="xcx_kuqypykrkldvqvdr " />
      <van-cell title="姓名" is-link :value="infolist.nickName" />
      <van-cell title="手机" is-link value="未填写 " />
      <van-cell title="性别" is-link :value="infolist.sex" />
      <van-cell title="地址管理" is-link style="margin: 20px 0" />
      <van-cell title="修改密码" is-link />
      <van-cell title="绑定其他账号" is-link style="margin-bottom: 10px" />
      <van-button type="default" style="width: 100%">退出当前账号</van-button>
    </main>
  </div>
</template>

<script>
import { userInfoApi } from "../utils/api";
export default {
  data() {
    return {
      infolist: {},
    };
  },
  mounted() {
    let token = localStorage.getItem("token");
    console.log(token);
    userInfoApi(token).then((res) => {
      this.infolist = res.result;
      console.log(this.infolist);
    });
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
  },
};
</script>

<style scoped>
.van-nav-bar .van-icon {
  color: #000;
}
.van-cell {
  color: #000;
}
</style>
